<%@ include file="/common/taglibs.jsp"%>
<title><fmt:message key="report.productSalesShort"/></title>
<head>
<script type="text/javascript" src="${ctxPath}/fusionCharts/JSClass/FusionCharts.js?rs=${appConfig.rs}"></script>
</head>
<content tag="buttons">
	<form id="reportForm" method="post" action="${ctxPath}/report/report.html?doAction=viewProductSalesRank" onkeypress="return keypress(event, 'reportForm')">
		<div id="searchFormContent" class="cnt">
			<fmt:message key="report.ranking"/>:
			<select name="topN" class="selecttxt" style="width:100px">
					<option value="10" <c:if test="${topN eq 10}">selected="true"</c:if>><fmt:message key="report.before10"/></option>
					<option value="20" <c:if test="${topN eq 20}">selected="true"</c:if>><fmt:message key="report.before20"/></option>
					<option value="50" <c:if test="${topN eq 50}">selected="true"</c:if>><fmt:message key="report.before50"/></option>
			</select>
			<span style="padding:5px"></span>
			<fmt:message key="report.date"/>:<fmt:message key="report.message.from"/><span><input id="startTime" name="startTime" value="${startTime}" class="input_readonly" readonly style="width:100px" validconf="required,date"/></span><probiz:ui_datePicker outPut="startTime"/>
			<fmt:message key="report.message.to"/><span><input id="endTime" name="endTime" value="${endTime}" class="input_readonly" readonly style="width:100px" validconf="required,date"/></span><probiz:ui_datePicker outPut="endTime"/>
			<span class="search_btn_box">
			<input class="search_btn" type="button" onclick="return producrSalesRankSearchSubmit();" title="<fmt:message key="button.search"/>" alt="<fmt:message key="button.search"/>" />&nbsp;&nbsp;
			</span>
		</div>
	</form>
</content>

<div class="data">
	<table width="100%" border="0" cellspacing="0" cellpadding="0" class="list_table" id="productRank">
		<tr>
			<th><fmt:message key="report.ranking"/></th>
			<th><fmt:message key="report.goodsNumber"/></th>
			<th><fmt:message key="report.goods"/></th>
			<th><fmt:message key="report.salesQuantity"/></th>
		</tr>
		<c:forEach items="${rankList}" var="rankItem">
			<tr>
				<td width="5%">
					${rankItem[0]}
				</td>
				<td width="10%">
					${rankItem[1]}
				</td>
				<td width="50%">
					${rankItem[2]}
					<c:if test="${not empty rankItem[3]}">
						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<fmt:message key="report.specification"/>：${rankItem[3]}
					</c:if>
				</td>
				<td>
					${rankItem[4]}
				</td>
			</tr>
		</c:forEach>
	</table>
</div>
<%@include file="../report/include/productSalesRankMsgJs.jspf" %>
<script type="text/javascript" src="${ctxPath}/scripts/probiz/report/reportSearchKeyPress.js?rs=${appConfig.rs}"></script>
<script type="text/javascript">
$j(document).ready(function () {
	highlightTableRows("productRank");
	autoApplyValidate(document.getElementById('reportForm'));
});
</script>